package cn.doitedu.datayiee_service17;

class BImpl{
    public void method(String param){
        // SOME LOGIC
    };
}

class Aimpl{

    BImpl b = new BImpl();

    public void doSomeThing() {
        b.method("param");
    }
}




// 版本2
interface BInterface{
    public void method(String param);
}


class BImp1 implements BInterface  {
    public void method(String param){
        // SOME LOGIC 1
    };
}

class BImp2 implements BInterface  {
    public void method(String param){
        // SOME LOGIC 2
    };
}

class AImpl{
    public static void main(String[] args) {
        // 通过配置文件获取所需要的实现类名
        String className = PropertyUtil.get("calssName");
        BInterface b = ReflectUtil.getInstance(className);
        b.method("param");
    }

}

class PropertyUtil{
    public static String get(String p){
        return null;
    }
}

class ReflectUtil{
    public static BInterface getInstance(String cls){
        return null;
    }
}



